<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2019/7/25 0025
 * Time: 9:44
 */

namespace app\storage\controller;

use app\storage\model\TransferModel;
use app\storage\service\CommonService;
use cmf\controller\AdminBaseController;
use think\Request;


class TransferController extends AdminBaseController
{
    protected $transferModel;
    protected $commonService;
    use \app\storage\util\Common;

    public function __construct(Request $request = null, TransferModel $transferModel,  CommonService $commonService)
    {
        parent::__construct($request);
        $this->transferModel = $transferModel;
        $this->commonService = $commonService;
    }

    /***
     * @return mixed
     * 中转区物料视图
     */
    public function index()
    {
        $assign = $this->getAssignStorage();
        $this->assign($assign);
        return $this->fetch('index');
    }

    public function getTransfer()
    {
        $where = $this->getWhere();
        $result = $this->transferModel->getTransfer($where);
        return json($result);
    }
}